<?php

namespace fastflow\driver\think;

use think\Db;
use fastflow\driver\interfaces\authTemplate;

class auth implements authTemplate
{
    
    public static function getAuthRow($param)
    {
        if (isset($param)) {
            $process = Db::table('__FASTFLOW_FLOW_AUTH__')->where($param)->select();
            if (count($process) == 0) {
                return 0;
            }
            return $process;
        }
        return false;
    }

    
    public static function setAuthRow($param)
    {
        if (isset($param)) {
            $count = Db::table('__FASTFLOW_FLOW_AUTH__')->update($param);
            return $count;
        }
        return false;
    }

    
    public static function addAuthRow($param)
    {
        if (isset($param)) {
            $id = Db::table('__FASTFLOW_FLOW_AUTH__')->insertGetId($param);
            return $id;
        }
        return false;
    }

    public static function getAuthCopyRow($param)
    {
        if (isset($param)) {
            $process = Db::table('__FASTFLOW_FLOW_AUTH_COPY__')->where($param)->select();
            if (count($process) == 0) {
                return 0;
            }
            return $process;
        }
        return false;
    }


    public static function setAuthCopyRow($param)
    {
        if (isset($param)) {
            $count = Db::table('__FASTFLOW_FLOW_AUTH_COPY__')->update($param);
            return $count;
        }
        return false;
    }


    public static function addAuthCopyRow($param)
    {
        if (isset($param)) {
            $id = Db::table('__FASTFLOW_FLOW_AUTH_COPY__')->insertGetId($param);
            return $id;
        }
        return false;
    }

    

}